﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using NG;

namespace NGDesign
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            EditComponent();
        }
        // 
        // tabPage1
        // 
        private void tabPage1_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 1;
        }

        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.tab1_link_lbl.Links[tab1_link_lbl.Links.IndexOf(e.Link)].Visited = true;
            System.Diagnostics.Process.Start("http://www.niramgitan.com/");
        }
        // 
        // tabPage2
        // 
        private void help_btn2_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }

        private void tab2_connect_Click(object sender, EventArgs e)
        {
                
            User user = new User(tab2_user_name_txt.Text,tab2_password_txt.Text , 0);
            IUserHandler IUH = new userHandler();
            if (IUH.login(user))
            {
                user_lbl3.Text = tab2_user_name_txt.Text;
                user_lbl4.Text = tab2_user_name_txt.Text;
                user_lbl5.Text = tab2_user_name_txt.Text;
                user_lbl6.Text = tab2_user_name_txt.Text;
                user_lbl7.Text = tab2_user_name_txt.Text;
                user_lbl8.Text = tab2_user_name_txt.Text;
                user_lbl9.Text = tab2_user_name_txt.Text;
                user_lbl10.Text = tab2_user_name_txt.Text;
                user_lbl11.Text = tab2_user_name_txt.Text;
                user_lbl12.Text = tab2_user_name_txt.Text;
                user_lbl13.Text = tab2_user_name_txt.Text;
                user_lbl14.Text = tab2_user_name_txt.Text;
                user_lbl15.Text = tab2_user_name_txt.Text;
                user_lbl16.Text = tab2_user_name_txt.Text;
                user_lbl17.Text = tab2_user_name_txt.Text;
                user_lbl18.Text = tab2_user_name_txt.Text;
                user_lbl19.Text = tab2_user_name_txt.Text;
                user_lbl20.Text = tab2_user_name_txt.Text;
                this.tabControl1.SelectedIndex = 2;
            }
            else
            {
                MessageBox.Show("שם משתמש או סיסמה שגויים,נסה שנית.");

            }
        }

        private void tab2_cancel_Click(object sender, EventArgs e)
        {
            Environment.Exit(0);
        }
        // 
        // tabPage3
        // 
        private void tab3_open_btn_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 3;
        }

        private void tab3_create_btn_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 4;
        }


        private void help_btn3_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage4
        // 
        private void back_to_menu4_Click(object sender, EventArgs e)
        {
            tab4_comboBox1.SelectedIndex = -1;
            tab4_comboBox2.SelectedIndex = -1;
            tab4_comboBox3.SelectedIndex = -1;
            tab4_comboBox4.SelectedIndex = -1;
            tab4_comboBox5.SelectedIndex = -1;
            tab4_comboBox6.SelectedIndex = -1;
            this.tabControl1.SelectedIndex = 2;
        }


        private void left_btn4_Click(object sender, EventArgs e)
        {
            IProjectHandler IPH = new projectHandler();
            LinkedList<Project> proList = IPH.allProjectsBysDep("project_no", true, (SubDepartment)tab4_comboBox6.SelectedItem,
                    (SubIndustry)tab4_comboBox2.SelectedItem);
            foreach (Project pro in proList)
            {
                string[] st = new string[4];
                st[0] = pro.ID.ToString();
                st[1] = pro.name;
                st[2] = pro.cname;
                st[3] = pro.oDate.ToString();


                ListViewItem items = new ListViewItem(st);
                items.Tag = pro;
                listView1.Items.Add(items);
            }         
        }

        private void mid_btn4_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }


        private void help_btn4_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage5
        // 
        private void back_to_menu5_Click(object sender, EventArgs e)
        {
            tab5_txt1.Text = string.Empty;
            tab5_txt2.Text = string.Empty;
            tab5_txt3.Text = string.Empty;
            tab5_txt4.Text = string.Empty;
            tab5_txt5.Text = string.Empty;
            tab5_txt6.Text = string.Empty;
            tab5_txt7.Text = string.Empty;
            tab5_txt8.Text = string.Empty;
            this.tabControl1.SelectedIndex = 2;
        }
        /*
         * tab5 screen:
         * in name of project and company just letters and numbers are allowed.
        */
        private void left_btn5_Click(object sender, EventArgs e)
        {
            foreach(char ch in tab5_txt1.Text)
            {
                if (!Char.IsLetterOrDigit(ch))
                {
                    MessageBox.Show("שם פרויקט לא תקין\nשם פרויקט יכול להכיל אותיות ומספרים בלבד וללא רווחים");
                    return;
                }
            }
            if(tab5_txt1.Text == "")
            {
                MessageBox.Show("נא להכניס שם פרויקט .");
                return;
            }
            foreach (char ch in tab5_txt2.Text)
            {
                if (!Char.IsLetterOrDigit(ch))
                {
                    MessageBox.Show("נא להכניס שם חברה מתאים\nשם חברה יכול להכיל אותיות ומספרים בלבד וללא רווחים.");
                    return;
                }
            }
            if (tab5_txt2.Text == "")
            {
                 MessageBox.Show("נא להכניס שם חברה מתאים.");
                    return;
            }
            int res;
            long res1;
            if (tab5_txt3.Text != string.Empty && long.TryParse(tab5_txt3.Text, out res1) == false)
            {
                    MessageBox.Show("נא להכניס מספר טלפון תקין.");
                    return;
            }
            if (tab5_txt6.Text != string.Empty && long.TryParse(tab5_txt6.Text, out res1) == false)
            {
                MessageBox.Show("נא להכניס מספר פקס תקין");
                return;
            }
            if (tab5_txt8.Text != string.Empty && (int.TryParse(tab5_txt8.Text, out res) == false || tab5_txt8.Text[0] == '0'))
            {
                MessageBox.Show("נא להכניס מספר עובדים תקין.");
                return;
            }
            if (tab5_txt8.Text == string.Empty)
                res = 0;
            else
                res = int.Parse(tab5_txt8.Text);
            if (res <= 0)
            {
                MessageBox.Show("נא להכניס מספר עובדים תקין.");
                return;
            }
            this.tabControl1.SelectedIndex = 5;
        }

        private void help_btn5_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage6
        // 
        private void back_to_menu6_Click(object sender, EventArgs e)
        {
            tab5_txt1.Text = string.Empty;
            tab5_txt2.Text = string.Empty;
            tab5_txt3.Text = string.Empty;
            tab5_txt4.Text = string.Empty;
            tab5_txt5.Text = string.Empty;
            tab5_txt6.Text = string.Empty;
            tab5_txt7.Text = string.Empty;
            tab5_txt8.Text = string.Empty;
            tab6_comboBox1.SelectedIndex = -1;
            tab6_comboBox2.SelectedIndex = -1;
            tab6_comboBox3.SelectedIndex = -1;
            tab6_comboBox4.SelectedIndex = -1;
            this.tabControl1.SelectedIndex = 2;
        }

        private void mid_btn6_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 4;
        }

        private void help_btn6_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }

        private void right_btn6_Click(object sender, EventArgs e)
        {
            int res,indust,subIndust;
            if (tab5_txt8.Text == string.Empty)
                res = 0;
            else
                res = int.Parse(tab5_txt8.Text);

            if (tab6_comboBox1.SelectedItem == null || tab6_comboBox2.SelectedItem == null)
            {
                MessageBox.Show("נא למלא את כל השדות.");
                return;
            }
            IsubIndustryHandler ISH = new subIndustryHandler();
            LinkedList<SubIndustry> sindList = ISH.allSubIndustriesByIndustry((Industry)tab4_comboBox1.SelectedItem);

            if (tab6_comboBox3.SelectedItem == null && sindList.Count > 0)
            {
                MessageBox.Show("נא למלא את כל השדות.");
                return;
            }

            ISubDepartmentHandler ISDH = new SubDepratmentHandler();
            LinkedList<SubDepartment> subdList = ISDH.allSubDeps("SubDepName", true, ((Department)(tab6_comboBox2.SelectedItem)));

            if (tab6_comboBox4.SelectedItem == null && subdList.Count > 0)
            {
                MessageBox.Show("נא למלא את כל השדות.");
                return;
            }
            indust = ((Industry)tab6_comboBox1.SelectedItem).industryNum;
            subIndust = ((SubIndustry)tab6_comboBox3.SelectedItem).subIndustry;
            Project proj = new Project(DateTime.Now, DateTime.Now, tab5_txt1.Text, tab5_txt2.Text, tab5_txt4.Text, tab5_txt6.Text, tab5_txt3.Text, tab5_txt7.Text, tab5_txt5.Text, res, tab5_rich_txt.Text,indust,subIndust);
            projectHandler PH = new projectHandler();
            PH.addProject(proj);
            UserProjectHandler UPH = new UserProjectHandler();
            User user = new User(user_lbl5.Text, "", 0);
            UPH.create(user, proj);
            ProjectDepartmentHandler PDH = new ProjectDepartmentHandler();
            PDH.AddProjectDepartment(proj, (SubDepartment)tab6_comboBox4.SelectedItem);
            this.tabControl1.SelectedIndex = 6;
        }
        // 
        // tabPage7
        // 
        private void back_to_menu7_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 2;
        }

        private void tab7_btn1_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 7;
        }

        private void tab7_btn4_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 9;
        }

        private void tab7_btn2_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
            //this.objectListView1.
        }

        private void tab7_btn3_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 14;
        }

        private void tab7_btn6_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 17;
        }

        private void help_btn7_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage8
        // 
        private void back_to_menu8_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void left_btn8_Click(object sender, EventArgs e)
        {
            
            this.tabControl1.SelectedIndex = 8;
        }

        private void help_btn8_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage9
        // 
        private void back_to_menu9_Click(object sender, EventArgs e)
        {
            //Help_Form frm = new Help_Form("חזרה לתפריט ראשי אינה שומרת עדכונים אחרונם, האם ברצונך לחזור בכל זאת?");
            //frm.richTextBox1.Dock = DockStyle.Top;
            //frm.Show();
            this.tabControl1.SelectedIndex = 6;
        }

        private void left_btn9_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void mid_btn9_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 7;
        }

        private void help_btn9_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage10
        // 
        private void back_to_menu10_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn10_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage11
        // 
        private void back_to_menu11_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn11_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage12
        // 
        private void back_to_menu12_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn12_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }

        private void left_btn12_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void mid_btn12_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }
        // 
        // tabPage13
        // 
        private void back_to_menu13_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn13_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage14
        // 
        private void back_to_menu14_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void mid_btn14_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void help_btn14_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage15
        // 
        private void back_to_menu15_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn15_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage16
        // 
        private void back_to_menu16_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void left_btn16_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 14;
        }

        private void help_btn16_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage17
        // 
        private void back_to_menu17_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void right_btn17_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 15;
        }

        private void help_btn17_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage18
        // 
        private void back_to_menu18_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn18_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }
        // 
        // tabPage19
        // 
        private void back_to_menu19_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 6;
        }

        private void help_btn19_Click(object sender, EventArgs e)
        {
            Help_Form frm = new Help_Form("");
            frm.Show();
        }

        private void tab4_comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
           
          
        }

        private void tab4_comboBox1_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox1.Items.Clear();
            LinkedList<Industry> industryList;
            IIndustryhandler IKH = new IndustryHandler();
            industryList = IKH.allIndustries("industryName", true);
            foreach (Industry indust in industryList)
            {

                tab4_comboBox1.Items.Add(indust);
            }
        }

        private void tab4_comboBox2_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox2.Items.Clear();
            if (tab4_comboBox1.SelectedItem != null)
            {
                IsubIndustryHandler ISH = new subIndustryHandler();
                LinkedList<SubIndustry> sindList = ISH.allSubIndustriesByIndustry((Industry)tab4_comboBox1.SelectedItem);
                
                foreach (SubIndustry sindust in sindList)
                {
                    tab4_comboBox2.Items.Add(sindust);
                }
            }
            else
            {
                MessageBox.Show("צריך לבחור ענף קודם");
            }
        }
        private void tab4_comboBox4_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox4.Items.Clear();
            LinkedList<Department> depList;
            IDepartmentHandler IDH = new DepartmentHandler();
            depList = IDH.allDeps("DepCode", true);
            foreach (Department dep in depList)
            {

                tab4_comboBox4.Items.Add(dep);
            }
        }

        private void tab4_comboBox6_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox6.Items.Clear();
            if (tab4_comboBox4.SelectedItem != null)
            {
                ISubDepartmentHandler ISH = new SubDepratmentHandler();
                LinkedList<SubDepartment> sdepList = ISH.allSubDeps("SubDepCode",true,(Department)tab4_comboBox4.SelectedItem);

                foreach (SubDepartment sdep in sdepList)
                {
                    tab4_comboBox6.Items.Add(sdep);
                }
            }
            else
            {
                MessageBox.Show("צריך לבחור מחלקה קודם");
            }
        }

        private void tab4_comboBox3_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox3.Items.Clear();
            LinkedList<AnalysisArea> AAList;
            IAnalysisArea IAH = new AnalysisAreaHandler();
            AAList= IAH.allAAs("AreaCode", true);
            foreach (AnalysisArea aa in AAList)
            {

                tab4_comboBox3.Items.Add(aa);
            }
        }

        private void tab4_comboBox5_DropDown(object sender, EventArgs e)
        {
            tab4_comboBox5.Items.Clear();
            if (tab4_comboBox3.SelectedItem != null)
            {
                ISubAnalaysisArea ISH = new SAAHandler();
                LinkedList<SubAnalaysisArea> sAAList = ISH.allSubAnalysisArea("SubAreaCode", true, (AnalysisArea)tab4_comboBox3.SelectedItem);

                foreach (SubAnalaysisArea saa in sAAList)
                {
                    tab4_comboBox5.Items.Add(saa);
                }
            }
            else
            {
                MessageBox.Show("צריך לבחור תחום אבחון קודם");
            }
        }
        private void right_btn13_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void left_btn14_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void left_btn6_Click(object sender, EventArgs e)
        {

        }

        private void tab10_TLP1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void left_btn18_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 18;
        }

        private void right1_btn19_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 17;
        }

        private void right2_btn19_Click(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 17;
        }

        private void tab10_btn4_Click(object sender, EventArgs e)
        {
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void left_btn12_Click_1(object sender, EventArgs e)
        {
            this.tabControl1.SelectedIndex = 10;
        }

        private void tab6_comboBox1_DropDown(object sender, EventArgs e)
        {
            tab6_comboBox1.Items.Clear();
            tab6_comboBox1.SelectedIndex = -1;
            tab6_comboBox3.SelectedIndex = -1;
            LinkedList<Industry> industryList;
            IIndustryhandler IKH = new IndustryHandler();
            industryList = IKH.allIndustries("industryName", true);
            foreach (Industry indust in industryList)
            {

                tab6_comboBox1.Items.Add(indust);
            }
        }

        private void tab6_comboBox3_DropDown(object sender, EventArgs e)
        {
            tab6_comboBox3.Items.Clear();
            tab6_comboBox3.SelectedIndex = -1;
            if (tab6_comboBox1.SelectedItem != null)
            {
                IsubIndustryHandler ISH = new subIndustryHandler();
                LinkedList<SubIndustry> sindList = ISH.allSubIndustriesByIndustry((Industry)tab6_comboBox1.SelectedItem);

                foreach (SubIndustry sindust in sindList)
                {
                    tab6_comboBox3.Items.Add(sindust);
                }
            }
            else
            {
                MessageBox.Show("צריך לבחור ענף קודם");
            }
        }

        private void tab6_comboBox2_DropDown(object sender, EventArgs e)
        {
            tab6_comboBox2.Items.Clear();
            tab6_comboBox2.SelectedIndex = -1;
            tab6_comboBox4.SelectedIndex = -1;
            LinkedList<Department> DepartmentList;
            IDepartmentHandler IDH = new DepartmentHandler();
            DepartmentList = IDH.allDeps("DepName", true);
            foreach (Department dep in DepartmentList)
            {
                tab6_comboBox2.Items.Add(dep);
            }
        }

        private void tab6_comboBox4_DropDown(object sender, EventArgs e)
        {
            tab6_comboBox4.Items.Clear();
            tab6_comboBox4.SelectedIndex = -1;
            if (tab6_comboBox2.SelectedItem != null)
            {
                ISubDepartmentHandler ISH = new SubDepratmentHandler();
                LinkedList<SubDepartment> sindList = ISH.allSubDeps("SubDepName", true,((Department)(tab6_comboBox2.SelectedItem)));
                foreach (SubDepartment sindust in sindList)
                {
                    tab6_comboBox4.Items.Add(sindust);
                }
            }
            else
            {
                MessageBox.Show("צריך לבחור מחלקה קודם");
            }
        }

        private void tab8_comboBox1_DropDown(object sender, EventArgs e)
        {
            tab8_comboBox1.Items.Clear();
            LinkedList<Dimension> DimList;
            IDimensionHandler DIMH = new DimensionHandler();
            DimList = DIMH.allDimensions("DimName",true);
            foreach (Dimension dim in DimList)
            {
                tab8_comboBox1.Items.Add(dim);
            }
        }

        private void tab8_comboBox4_DropDown(object sender, EventArgs e)
        {
            tab8_comboBox4.Items.Clear();
            tab8_comboBox7.SelectedIndex = -1;
            LinkedList<AnalysisArea> AnaList;
            IAnalysisArea IAH = new AnalysisAreaHandler();
            AnaList = IAH.allAAs("AreaName", true);
            foreach (AnalysisArea ana in AnaList)
            {
                tab8_comboBox4.Items.Add(ana);
            }
        }

        private void tab8_comboBox7_DropDown(object sender, EventArgs e)
        {
            tab8_comboBox7.Items.Clear();
            if (tab8_comboBox4.SelectedItem != null)
            {
                SAAHandler ISa = new SAAHandler();
                LinkedList<SubAnalaysisArea> sindList = ISa.allSubAnalysisArea("SubAreaName", true);
                foreach (SubAnalaysisArea subana in sindList)
                {
                    tab8_comboBox7.Items.Add(subana);
                }
            }
            else
            {
                MessageBox.Show("נא להכניס תחום קודם.");
                return;
            }
        }

        private void tab8_comboBox3_DropDown(object sender, EventArgs e)
        {
            tab8_comboBox3.Items.Clear();
            LinkedList<KSF> ksfList;
            IKSFHandler IKH = new KSFHandler();
            ksfList = IKH.allKSFs("KSFName", true);
            foreach (KSF k in ksfList)
            {
                tab8_comboBox3.Items.Add(k);
            }
        }

        private void tab8_comboBox6_DropDown(object sender, EventArgs e)
        {
            
        }

        private void tab8_btn1_Click(object sender, EventArgs e)
        {
        }

        private void tab8_comboBox3_SelectedValueChanged(object sender, EventArgs e)
        {
            richTextBox2.Text = ((KSF)(tab8_comboBox3.SelectedItem)).ksfDiscription;
        }

        private void label10_Click(object sender, EventArgs e)
        {

        }

        private void tab9_lbl3_Click(object sender, EventArgs e)
        {

        }

        private void tab8_btn1_Click_1(object sender, EventArgs e)
        {
            DataTable table = new DataTable();
            table.Columns.Add("KSFName",typeof(string));
            table.Columns.Add("KSFDescription",typeof(string));
            table.Columns.Add("Weight",typeof(TextBox));
            table.Columns[2].ReadOnly = false;
            KSF ksf =  (KSF)tab8_comboBox3.SelectedItem ;
            table.Rows.Add(ksf.ksfName,ksf.ksfDiscription);
            dataGridView1.DataSource = table;
        }
   
        // 
        // End
        // 
    }
}
